import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 维修质量反馈单主页面查询
export const getMainList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/searchFeedbackList`, { params });

// 根据反馈单号查询明细信息
export const queryLabour = (feedbackNo, params) => axios.get(`${SERVER.DMSCLOUD_REPAIR}//qualitityFeedback/searchFeedbackbyNo/${feedbackNo}`, { params });

// 主页面保存
// export const mainSave = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/btnSave`, params);

// 工单查询
export const searchRoList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/searchRoList`, { params });

// 新增反馈单保存
export const addSave = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/btnSave`, params);

// 编辑反馈单保存
export const editSave = params => axios.put(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/btnSave`, params);

// 提交
export const submitFeedback = (feedbackNo, params) => axios.post(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/submit/${feedbackNo}`, params);

// 删除
export const deleteFeedback = id => axios.delete(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/delete/${id}`);

// 故障部位查询
export const searchFaultLocation = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/faultLocation`, { params });

// 缺陷类型查询
export const searchFaultType = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/qualitityFeedback/faultType`, { params });
